package com.epic.quartz.service;

import com.epic.inter.ITask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component("QuartzTask")
public class QuartzTask implements ITask {
    private static Logger logger =  LoggerFactory.getLogger(QuartzTask.class);
    @Override
    public void task() {

        logger.info("lkkstart");
        try{
            String str = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
            logger.info("out put time: " + str);
        }catch (Exception e){
            logger.error(e.getMessage());
        }
        logger.info("taskend");
    }
}
